/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package XML;

import Offer.Offer;
import Offer.OfferList;
import java.io.FileNotFoundException;
import java.text.ParseException;
import javax.xml.stream.XMLStreamException;

/**
 *
 * @author Dopsilon
 */
public class XMLTester {
    
    public static void main(String args[]){
        try {
            XMLReader testare = new XMLReader();
            OfferList offerList = new OfferList();
            
            while (testare.hasNext()) {
                Offer temp;
                temp = testare.buildOffer();
                if(temp != null){                    
                   offerList.addOffer(temp);                            
                }             
            }
            
            for (Offer o : offerList) {
               System.out.println(o.getDestinationName());
               
               
                
            }
        } catch (FileNotFoundException | XMLStreamException | ParseException ex) {
           System.out.println(ex.getLocalizedMessage());
        } 
        
        
        
    }
    
}
